From: Sebastian Keller Date: Sun, 16 Apr 2023 21:23:11 +0000 (+0200) Subject: st/icon-theme: Fix small memory leak when checking fallback theme path X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~371^2^2~34 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=15048c1fcbf63e5e7f6f1651130208a0313fc93c;p=gnome-shell.git st/icon-theme: Fix small memory leak when checking fallback theme path This is a small one time leak if there is more than one entry in the search path due to multiple iterations overwriting the old pointer before finally going out of scope. Fixes: 934faaace ("st/icon-theme: Start using g_autofree") Part-of: --- diff --git a/src/st/st-icon-theme.c b/src/st/st-icon-theme.c index 9edde5c77..9128c57ef 100644 --- a/src/st/st-icon-theme.c +++ b/src/st/st-icon-theme.c @@ -1413,7 +1413,6 @@ real_choose_icon (StIconTheme *icon_theme, else { static gboolean check_for_default_theme = TRUE; - g_autofree char *default_theme_path = NULL; gboolean found = FALSE; if (check_for_default_theme) @@ -1422,6 +1421,8 @@ real_choose_icon (StIconTheme *icon_theme, for (i = 0; !found && i < icon_theme->search_path_len; i++) { + g_autofree char *default_theme_path = NULL; + default_theme_path = g_build_filename (icon_theme->search_path[i], FALLBACK_ICON_THEME, "index.theme",